
<?php 
	$latitude = $_POST['latitude'];
	$longitude = $_POST['longitude'];
	
	//Include database connection details
	require_once('../../connection/config.php');
	
	//Connect to mysql server
	$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
	if(!$link) {
		die('Error al conectarse con el Servidor: ' . mysql_error());
	}
	
	//Select database
	$db = mysql_select_db(DB_DATABASE);
	if(!$db) {
		die("Error al Seleccionar Base de Datos");
	}
	
	//Create query	
	
	$qry="INSERT INTO rastreo(latitud, longitud) VALUES ('".$latitude."','".$longitude."')";
	$result=mysql_query($qry);
	print_r($qry);
	print_r($result);
	
	
?>
